Component({
  data: {
    selected: 0,
    color: "#A2AACA",
    selectedColor: "#2C65A7",
    list: [{
      pagePath: "/pages/index/index",
      iconPath: "/images/tabbar_icon1.png",
      selectedIconPath: "/images/tabbar_icon1_select.png",
      text: "首页"
    }, {
      pagePath: "/pages/msg/index",
      iconPath: "/images/tabbar_icon2.png",
      selectedIconPath: "/images/tabbar_icon2_select.png",
      text: "消息"
    },{
      pagePath: "/pages/my/index",
      iconPath: "/images/tabbar_icon3.png",
      selectedIconPath: "/images/tabbar_icon3_select.png",
      text: "我的"
    }]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})